
BEGIN TRANSACTION
GO
ALTER TABLE dbo.Accounts ADD
	ComPercent numeric(11, 2) NOT NULL CONSTRAINT DF_Accounts_ComPercent DEFAULT 0
GO
COMMIT

---------------------------------------------------------------------------

BEGIN TRANSACTION
GO
ALTER TABLE dbo.Voucher ADD
	PrvBalance numeric(15, 2) NOT NULL CONSTRAINT DF_Voucher_PrvBalance DEFAULT 0
GO
COMMIT

---------------------------------------------------------------------------

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Ports]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Ports]
GO

CREATE TABLE [dbo].[Ports](
	[PortID] [tinyint] IDENTITY(1,1) NOT NULL,
	[PortName] [varchar](20) NOT NULL,
	[SimNo] [varchar](20) NOT NULL,
	[ComNo] [varchar](10) NOT NULL,
	[BuadRate] [numeric](9, 2) NOT NULL CONSTRAINT [DF_Ports_BuadRate_1]  DEFAULT ((0)),
	[AutoStartonStartup] [bit] NOT NULL CONSTRAINT [DF_Ports_AutoStartonStartup]  DEFAULT ((0)),
	[LUser] [varchar](100) NULL,
	[LPwd] [varchar](100) NULL,
	[MasterNo1] [varchar](20) NULL,
	[MasterNo2] [varchar](20) NULL,
 CONSTRAINT [PK_Ports] PRIMARY KEY CLUSTERED 
(
	[PortID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

